From: Brion Vibber Date: Sat, 14 Aug 2004 08:22:38 +0000 (+0000) Subject: Go direct to the page list if there are only one or two pages' worth of X-Git-Tag: 1.5.0alpha1~2372 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=20c3c7f7d88f3e856248c7574409b27234ab0926;p=lhc%2Fweb%2Fwiklou.git Go direct to the page list if there are only one or two pages' worth of titles to list. (Timwi's patch plus style tweak.) Bug 18: Improve Allpages display on small wikis http://bugzilla.wikipedia.org/show_bug.cgi?id=18 --- diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index 74b9054bee..e2a2893597 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -77,6 +77,13 @@ function indexShowToplevel ( $namespace = 0 ) $count = $dbr->selectField( 'cur', 'COUNT(*)', $where, $fname ); $sections = ceil( $count / $indexMaxperpage ); + if ( $sections < 3 ) { + # If there are only two or less sections, don't even display them. + # Instead, display the first section directly. + indexShowChunk( '', $namespace ); + return; + } + # We want to display $toplevelMaxperpage lines starting at $offset. # NOTICE: $offset starts at 0 $offset = intval ( $wgRequest->getVal( 'offset' ) );